{{ block 'header'}}
<!-- <link rel="stylesheet" href="../../public/css/global.css"> -->
<link rel="stylesheet" href="../../public/css/header.css">
{{ /block }}

<div class="container">
    <nav class="navContainer">
        <ul class="nav-left">
            <li>
                <a href="/">
                    <h1>仿博客</h1>
                </a>
            </li>
            <li>
                <form action="/search">
                    <input type="text" name="keyCode" id="search" placeholder="请输入关键词">
                    <a href="/edit" class="btn">搜索</a>
                </form>
            </li>
            <li><a href="/">首页</a></li>
        </ul>
        <ul class="nav-right">
            {{ if user }}
            <li class="show_user">
                <img src="../../public/img/user.jpeg" alt="用户头像">
                <ul class="user_info">
                    <li>
                        <p>用户: {{ user.nickname }}</p>
                    </li>
                    <li><a href="/settings/profile">个人主页</a></li>
                    <li><a href="/settings/admin">设置</a></li>
                    <li><a href="/logout">退出</a></li>
                </ul>
            </li>
            <li><a href="/topics/edit" class="btn">发起</a></li>
            {{ else }}
            <li><a href="/login" class="btn">登录</a></li>
            <li><a href="/register" class="btn">注册</a></li>
            {{ /if }}
        </ul>
    </nav>
</div>